home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / HFSVolumes.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  20.4 KB  |  420 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        HFSVolumes.a
  3. ;
  4. ;    Contains:    On-disk data structures for HFS and HFS Plus volumes.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1984-1998 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__HFSVOLUMES__') = 'UNDEFINED' THEN
  18. __HFSVOLUMES__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  24.     include 'Files.a'
  25.     ENDIF
  26.     IF &TYPE('__FINDER__') = 'UNDEFINED' THEN
  27.     include 'Finder.a'
  28.     ENDIF
  29.  
  30. ;  Signatures used to differentiate between HFS and HFS Plus volumes 
  31.  
  32. kHFSSigWord                        EQU        $4244                ; 'BD' in ASCII 
  33. kHFSPlusSigWord                    EQU        $482B                ; 'H+' in ASCII 
  34. kHFSPlusVersion                    EQU        $0004                ; will change as format changes (version 4 shipped with Mac OS 8.1) 
  35. kHFSPlusMountVersion            EQU        '8.10'                ; will change as implementations change ('8.10' in Mac OS 8.1) 
  36.  
  37. ;  CatalogNodeID is used to track catalog objects 
  38. ; typedef UInt32                         HFSCatalogNodeID
  39.  
  40. ;  Unicode strings are used for file and folder names (HFS Plus only) 
  41. HFSUniStr255            RECORD 0
  42. length                     ds.w    1                ; offset: $0 (0)        ;  number of unicode characters 
  43. unicode                     ds.w    255                ; offset: $2 (2)        ;  unicode characters 
  44. sizeof                     EQU *                    ; size:   $200 (512)
  45.                         ENDR
  46. ; typedef const struct HFSUniStr255 *    ConstHFSUniStr255Param
  47.  
  48.  
  49. kHFSMaxVolumeNameChars            EQU        27
  50. kHFSMaxFileNameChars            EQU        31
  51. kHFSPlusMaxFileNameChars        EQU        255
  52.  
  53. ;  Extent overflow file data structures 
  54. ;  HFS Extent key 
  55. HFSExtentKey            RECORD 0
  56. keyLength                 ds.b    1                ; offset: $0 (0)        ;  length of key, excluding this field 
  57. forkType                 ds.b    1                ; offset: $1 (1)        ;  0 = data fork, FF = resource fork 
  58. fileID                     ds.l    1                ; offset: $2 (2)        ;  file ID 
  59. startBlock                 ds.w    1                ; offset: $6 (6)        ;  first file allocation block number in this extent 
  60. sizeof                     EQU *                    ; size:   $8 (8)
  61.                         ENDR
  62. ;  HFS Plus Extent key 
  63. HFSPlusExtentKey        RECORD 0
  64. keyLength                 ds.w    1                ; offset: $0 (0)        ;  length of key, excluding this field 
  65. forkType                 ds.b    1                ; offset: $2 (2)        ;  0 = data fork, FF = resource fork 
  66. pad                         ds.b    1                ; offset: $3 (3)        ;  make the other fields align on 32-bit boundary 
  67. fileID                     ds.l    1                ; offset: $4 (4)        ;  file ID 
  68. startBlock                 ds.l    1                ; offset: $8 (8)        ;  first file allocation block number in this extent 
  69. sizeof                     EQU *                    ; size:   $C (12)
  70.                         ENDR
  71. ;  Number of extent descriptors per extent record 
  72.  
  73. kHFSExtentDensity                EQU        3
  74. kHFSPlusExtentDensity            EQU        8
  75. ;  HFS extent descriptor 
  76. HFSExtentDescriptor        RECORD 0
  77. startBlock                 ds.w    1                ; offset: $0 (0)        ;  first allocation block 
  78. blockCount                 ds.w    1                ; offset: $2 (2)        ;  number of allocation blocks 
  79. sizeof                     EQU *                    ; size:   $4 (4)
  80.                         ENDR
  81. ;  HFS Plus extent descriptor 
  82. HFSPlusExtentDescriptor    RECORD 0
  83. startBlock                 ds.l    1                ; offset: $0 (0)        ;  first allocation block 
  84. blockCount                 ds.l    1                ; offset: $4 (4)        ;  number of allocation blocks 
  85. sizeof                     EQU *                    ; size:   $8 (8)
  86.                         ENDR
  87. ;  HFS extent record 
  88. HFSExtentRecord            RECORD 0
  89. elements                 ds.b    3 * HFSExtentDescriptor.sizeof
  90. sizeof                     EQU *                    ; size:   $C (12)
  91.                         ENDR
  92.  
  93.  
  94. ;  HFS Plus extent record 
  95. HFSPlusExtentRecord        RECORD 0
  96. elements                 ds.b    8 * HFSPlusExtentDescriptor.sizeof
  97. sizeof                     EQU *                    ; size:   $40 (64)
  98.                         ENDR
  99.  
  100.  
  101.  
  102. ;  Fork data info (HFS Plus only) - 80 bytes 
  103. HFSPlusForkData            RECORD 0
  104. logicalSize                 ds        UInt64            ; offset: $0 (0)        ;  fork's logical size in bytes 
  105. clumpSize                 ds.l    1                ; offset: $8 (8)        ;  fork's clump size in bytes 
  106. totalBlocks                 ds.l    1                ; offset: $C (12)        ;  total blocks used by this fork 
  107. extents                     ds        HFSPlusExtentRecord ; offset: $10 (16) ;  initial set of extents 
  108. sizeof                     EQU *                    ; size:   $50 (80)
  109.                         ENDR
  110. ;  Permissions info (HFS Plus only) - 16 bytes 
  111. HFSPlusPermissions        RECORD 0
  112. ownerID                     ds.l    1                ; offset: $0 (0)        ;  user or group ID of file/folder owner 
  113. groupID                     ds.l    1                ; offset: $4 (4)        ;  additional user of group ID 
  114. permissions                 ds.l    1                ; offset: $8 (8)        ;  permissions (bytes: unused, owner, group, everyone) 
  115. specialDevice             ds.l    1                ; offset: $C (12)        ;  UNIX: device for character or block special file 
  116. sizeof                     EQU *                    ; size:   $10 (16)
  117.                         ENDR
  118. ;  Catalog file data structures 
  119.  
  120. kHFSRootParentID                EQU        1                    ; Parent ID of the root folder 
  121. kHFSRootFolderID                EQU        2                    ; Folder ID of the root folder 
  122. kHFSExtentsFileID                EQU        3                    ; File ID of the extents file 
  123. kHFSCatalogFileID                EQU        4                    ; File ID of the catalog file 
  124. kHFSBadBlockFileID                EQU        5                    ; File ID of the bad allocation block file 
  125. kHFSAllocationFileID            EQU        6                    ; File ID of the allocation file (HFS Plus only) 
  126. kHFSStartupFileID                EQU        7                    ; File ID of the startup file (HFS Plus only) 
  127. kHFSAttributesFileID            EQU        8                    ; File ID of the attribute file (HFS Plus only) 
  128. kHFSBogusExtentFileID            EQU        15                    ; Used for exchanging extents in extents file 
  129. kHFSFirstUserCatalogNodeID        EQU        16
  130.  
  131. ;  HFS catalog key 
  132. HFSCatalogKey            RECORD 0
  133. keyLength                 ds.b    1                ; offset: $0 (0)        ;  key length (in bytes) 
  134. reserved                 ds.b    1                ; offset: $1 (1)        ;  reserved (set to zero) 
  135. parentID                 ds.l    1                ; offset: $2 (2)        ;  parent folder ID 
  136. nodeName                 ds        Str31            ; offset: $6 (6)        ;  catalog node name 
  137. sizeof                     EQU *                    ; size:   $26 (38)
  138.                         ENDR
  139. ;  HFS Plus catalog key 
  140. HFSPlusCatalogKey        RECORD 0
  141. keyLength                 ds.w    1                ; offset: $0 (0)        ;  key length (in bytes) 
  142. parentID                 ds.l    1                ; offset: $2 (2)        ;  parent folder ID 
  143. nodeName                 ds        HFSUniStr255    ; offset: $6 (6)        ;  catalog node name 
  144. sizeof                     EQU *                    ; size:   $206 (518)
  145.                         ENDR
  146.  
  147. ;  Catalog record types 
  148.  
  149.                                                             ; HFS Catalog Records 
  150. kHFSFolderRecord                EQU        $0100                ; Folder record 
  151. kHFSFileRecord                    EQU        $0200                ; File record 
  152. kHFSFolderThreadRecord            EQU        $0300                ; Folder thread record 
  153. kHFSFileThreadRecord            EQU        $0400                ; File thread record 
  154.                                                             ; HFS Plus Catalog Records 
  155. kHFSPlusFolderRecord            EQU        1                    ; Folder record 
  156. kHFSPlusFileRecord                EQU        2                    ; File record 
  157. kHFSPlusFolderThreadRecord        EQU        3                    ; Folder thread record 
  158. kHFSPlusFileThreadRecord        EQU        4                    ; File thread record 
  159.  
  160. ;  Catalog file record flags 
  161.  
  162. kHFSFileLockedBit                EQU        $0000                ; file is locked and cannot be written to 
  163. kHFSFileLockedMask                EQU        $0001
  164. kHFSThreadExistsBit                EQU        $0001                ; a file thread record exists for this file 
  165. kHFSThreadExistsMask            EQU        $0002
  166.  
  167. ;  HFS catalog folder record - 70 bytes 
  168. HFSCatalogFolder        RECORD 0
  169. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  170. flags                     ds.w    1                ; offset: $2 (2)        ;  folder flags 
  171. valence                     ds.w    1                ; offset: $4 (4)        ;  folder valence 
  172. folderID                 ds.l    1                ; offset: $6 (6)        ;  folder ID 
  173. createDate                 ds.l    1                ; offset: $A (10)        ;  date and time of creation 
  174. modifyDate                 ds.l    1                ; offset: $E (14)        ;  date and time of last modification 
  175. backupDate                 ds.l    1                ; offset: $12 (18)        ;  date and time of last backup 
  176. userInfo                 ds        DInfo            ; offset: $16 (22)        ;  Finder information 
  177. finderInfo                 ds        DXInfo            ; offset: $26 (38)        ;  additional Finder information 
  178. reserved                 ds.l    4                ; offset: $36 (54)        ;  reserved - set to zero 
  179. sizeof                     EQU *                    ; size:   $46 (70)
  180.                         ENDR
  181. ;  HFS Plus catalog folder record - 88 bytes 
  182. HFSPlusCatalogFolder    RECORD 0
  183. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type = HFS Plus folder record 
  184. flags                     ds.w    1                ; offset: $2 (2)        ;  file flags 
  185. valence                     ds.l    1                ; offset: $4 (4)        ;  folder's valence (limited to 2^16 in Mac OS) 
  186. folderID                 ds.l    1                ; offset: $8 (8)        ;  folder ID 
  187. createDate                 ds.l    1                ; offset: $C (12)        ;  date and time of creation 
  188. contentModDate             ds.l    1                ; offset: $10 (16)        ;  date and time of last content modification 
  189. attributeModDate         ds.l    1                ; offset: $14 (20)        ;  date and time of last attribute modification 
  190. accessDate                 ds.l    1                ; offset: $18 (24)        ;  date and time of last access (Rhapsody only) 
  191. backupDate                 ds.l    1                ; offset: $1C (28)        ;  date and time of last backup 
  192. permissions                 ds        HFSPlusPermissions ; offset: $20 (32)    ;  permissions (for Rhapsody) 
  193. userInfo                 ds        DInfo            ; offset: $30 (48)        ;  Finder information 
  194. finderInfo                 ds        DXInfo            ; offset: $40 (64)        ;  additional Finder information 
  195. textEncoding             ds.l    1                ; offset: $50 (80)        ;  hint for name conversions 
  196. reserved                 ds.l    1                ; offset: $54 (84)        ;  reserved - set to zero 
  197. sizeof                     EQU *                    ; size:   $58 (88)
  198.                         ENDR
  199. ;  HFS catalog file record - 102 bytes 
  200. HFSCatalogFile            RECORD 0
  201. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  202. flags                     ds.b    1                ; offset: $2 (2)        ;  file flags 
  203. fileType                 ds.b    1                ; offset: $3 (3)        ;  file type (unused ?) 
  204. userInfo                 ds        FInfo            ; offset: $4 (4)        ;  Finder information 
  205. fileID                     ds.l    1                ; offset: $14 (20)        ;  file ID 
  206. dataStartBlock             ds.w    1                ; offset: $18 (24)        ;  not used - set to zero 
  207. dataLogicalSize             ds.l    1                ; offset: $1A (26)        ;  logical EOF of data fork 
  208. dataPhysicalSize         ds.l    1                ; offset: $1E (30)        ;  physical EOF of data fork 
  209. rsrcStartBlock             ds.w    1                ; offset: $22 (34)        ;  not used - set to zero 
  210. rsrcLogicalSize             ds.l    1                ; offset: $24 (36)        ;  logical EOF of resource fork 
  211. rsrcPhysicalSize         ds.l    1                ; offset: $28 (40)        ;  physical EOF of resource fork 
  212. createDate                 ds.l    1                ; offset: $2C (44)        ;  date and time of creation 
  213. modifyDate                 ds.l    1                ; offset: $30 (48)        ;  date and time of last modification 
  214. backupDate                 ds.l    1                ; offset: $34 (52)        ;  date and time of last backup 
  215. finderInfo                 ds        FXInfo            ; offset: $38 (56)        ;  additional Finder information 
  216. clumpSize                 ds.w    1                ; offset: $48 (72)        ;  file clump size (not used) 
  217. dataExtents                 ds        HFSExtentRecord ; offset: $4A (74)        ;  first data fork extent record 
  218. rsrcExtents                 ds        HFSExtentRecord ; offset: $56 (86)        ;  first resource fork extent record 
  219. reserved                 ds.l    1                ; offset: $62 (98)        ;  reserved - set to zero 
  220. sizeof                     EQU *                    ; size:   $66 (102)
  221.                         ENDR
  222. ;  HFS Plus catalog file record - 248 bytes 
  223. HFSPlusCatalogFile        RECORD 0
  224. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type = HFS Plus file record 
  225. flags                     ds.w    1                ; offset: $2 (2)        ;  file flags 
  226. reserved1                 ds.l    1                ; offset: $4 (4)        ;  reserved - set to zero 
  227. fileID                     ds.l    1                ; offset: $8 (8)        ;  file ID 
  228. createDate                 ds.l    1                ; offset: $C (12)        ;  date and time of creation 
  229. contentModDate             ds.l    1                ; offset: $10 (16)        ;  date and time of last content modification 
  230. attributeModDate         ds.l    1                ; offset: $14 (20)        ;  date and time of last attribute modification 
  231. accessDate                 ds.l    1                ; offset: $18 (24)        ;  date and time of last access (Rhapsody only) 
  232. backupDate                 ds.l    1                ; offset: $1C (28)        ;  date and time of last backup 
  233. permissions                 ds        HFSPlusPermissions ; offset: $20 (32)    ;  permissions (for Rhapsody) 
  234. userInfo                 ds        FInfo            ; offset: $30 (48)        ;  Finder information 
  235. finderInfo                 ds        FXInfo            ; offset: $40 (64)        ;  additional Finder information 
  236. textEncoding             ds.l    1                ; offset: $50 (80)        ;  hint for name conversions 
  237. reserved2                 ds.l    1                ; offset: $54 (84)        ;  reserved - set to zero 
  238. ;  start on double long (64 bit) boundry 
  239. dataFork                 ds        HFSPlusForkData ; offset: $58 (88)        ;  size and block data for data fork 
  240. resourceFork             ds        HFSPlusForkData ; offset: $A8 (168)        ;  size and block data for resource fork 
  241. sizeof                     EQU *                    ; size:   $F8 (248)
  242.                         ENDR
  243. ;  HFS catalog thread record - 46 bytes 
  244. HFSCatalogThread        RECORD 0
  245. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  246. reserved                 ds.l    2                ; offset: $2 (2)        ;  reserved - set to zero 
  247. parentID                 ds.l    1                ; offset: $A (10)        ;  parent ID for this catalog node 
  248. nodeName                 ds        Str31            ; offset: $E (14)        ;  name of this catalog node 
  249. sizeof                     EQU *                    ; size:   $2E (46)
  250.                         ENDR
  251. ;  HFS Plus catalog thread record -- 264 bytes 
  252. HFSPlusCatalogThread    RECORD 0
  253. recordType                 ds.w    1                ; offset: $0 (0)        ;  record type 
  254. reserved                 ds.w    1                ; offset: $2 (2)        ;  reserved - set to zero 
  255. parentID                 ds.l    1                ; offset: $4 (4)        ;  parent ID for this catalog node 
  256. nodeName                 ds        HFSUniStr255    ; offset: $8 (8)        ;  name of this catalog node (variable length) 
  257. sizeof                     EQU *                    ; size:   $208 (520)
  258.                         ENDR
  259.  
  260.  
  261. ;      These are the types of records in the attribute B-tree.  The values were chosen
  262. ;      so that they wouldn't conflict with the catalog record types.
  263.  
  264.  
  265.  
  266. kHFSPlusAttrInlineData            EQU        $10                    ; if size <  kAttrOverflowSize 
  267. kHFSPlusAttrForkData            EQU        $20                    ; if size >= kAttrOverflowSize 
  268. kHFSPlusAttrExtents                EQU        $30                    ; overflow extents for large attributes 
  269.  
  270.  
  271. ;      HFSPlusAttrInlineData
  272. ;      For small attributes, whose entire value is stored within this one
  273. ;      B-tree record.
  274. ;      There would not be any other records for this attribute.
  275.  
  276.  
  277. HFSPlusAttrInlineData    RECORD 0
  278. recordType                 ds.l    1                ; offset: $0 (0)        ;     = kHFSPlusAttrInlineData
  279. reserved                 ds.l    1                ; offset: $4 (4)
  280. logicalSize                 ds.l    1                ; offset: $8 (8)        ;     size in bytes of userData
  281. userData                 ds.b    2                ; offset: $C (12)        ;     variable length; space allocated is a multiple of 2 bytes
  282. sizeof                     EQU *                    ; size:   $E (14)
  283.                         ENDR
  284.  
  285. ;      HFSPlusAttrForkData
  286. ;      For larger attributes, whose value is stored in allocation blocks.
  287. ;      If the attribute has more than 8 extents, there will be additonal
  288. ;      records (of type HFSPlusAttrExtents) for this attribute.
  289.  
  290.  
  291. HFSPlusAttrForkData        RECORD 0
  292. recordType                 ds.l    1                ; offset: $0 (0)        ;     = kHFSPlusAttrForkData
  293. reserved                 ds.l    1                ; offset: $4 (4)
  294. theFork                     ds        HFSPlusForkData ; offset: $8 (8)        ;     size and first extents of value
  295. sizeof                     EQU *                    ; size:   $58 (88)
  296.                         ENDR
  297.  
  298. ;      HFSPlusAttrExtents
  299. ;      This record contains information about overflow extents for large,
  300. ;      fragmented attributes.
  301.  
  302.  
  303. HFSPlusAttrExtents        RECORD 0
  304. recordType                 ds.l    1                ; offset: $0 (0)        ;     = kHFSPlusAttrExtents
  305. reserved                 ds.l    1                ; offset: $4 (4)
  306. extents                     ds        HFSPlusExtentRecord ; offset: $8 (8)    ;     additional extents
  307. sizeof                     EQU *                    ; size:   $48 (72)
  308.                         ENDR
  309. ;     A generic Attribute Record
  310. HFSPlusAttrRecord        RECORD 0
  311. recordType                 ds.l    1                ; offset: $0 (0)
  312.                          ORG 0
  313. inlineData                 ds        HFSPlusAttrInlineData ; offset: $0 (0)
  314.                          ORG 0
  315. forkData                 ds        HFSPlusAttrForkData ; offset: $0 (0)
  316.                          ORG 0
  317. overflowExtents             ds        HFSPlusAttrExtents ; offset: $0 (0)
  318.                          ORG 88
  319. sizeof                     EQU *                    ; size:   $58 (88)
  320.                         ENDR
  321. ;  Key and node lengths 
  322.  
  323. kHFSPlusExtentKeyMaximumLength    EQU        10
  324. kHFSExtentKeyMaximumLength        EQU        7
  325. kHFSPlusCatalogKeyMaximumLength    EQU        516
  326. kHFSPlusCatalogKeyMinimumLength    EQU        6
  327. kHFSCatalogKeyMaximumLength        EQU        37
  328. kHFSCatalogKeyMinimumLength        EQU        6
  329. kHFSPlusCatalogMinNodeSize        EQU        4096
  330. kHFSPlusExtentMinNodeSize        EQU        512
  331. kHFSPlusAttrMinNodeSize            EQU        4096
  332.  
  333. ;  HFS and HFS Plus volume attribute bits 
  334.  
  335.                                                             ; Bits 0-6 are reserved (always cleared by MountVol call) 
  336. kHFSVolumeHardwareLockBit        EQU        7                    ; volume is locked by hardware 
  337. kHFSVolumeUnmountedBit            EQU        8                    ; volume was successfully unmounted 
  338. kHFSVolumeSparedBlocksBit        EQU        9                    ; volume has bad blocks spared 
  339. kHFSVolumeNoCacheRequiredBit    EQU        10                    ; don't cache volume blocks (i.e. RAM or ROM disk) 
  340. kHFSBootVolumeInconsistentBit    EQU        11                    ; boot volume is inconsistent (System 7.6 and later) 
  341.                                                             ; Bits 12-14 are reserved for future use 
  342. kHFSVolumeSoftwareLockBit        EQU        15                    ; volume is locked by software 
  343. kHFSVolumeHardwareLockMask        EQU        $80
  344. kHFSVolumeUnmountedMask            EQU        $0100
  345. kHFSVolumeSparedBlocksMask        EQU        $0200
  346. kHFSVolumeNoCacheRequiredMask    EQU        $0400
  347. kHFSBootVolumeInconsistentMask    EQU        $0800
  348. kHFSVolumeSoftwareLockMask        EQU        $8000
  349. kHFSMDBAttributesMask            EQU        $8380
  350.  
  351. ;  Master Directory Block (HFS only) - 162 bytes 
  352. ;  Stored at sector #2 (3rd sector) 
  353. HFSMasterDirectoryBlock    RECORD 0
  354. ;  These first fields are also used by MFS 
  355. drSigWord                 ds.w    1                ; offset: $0 (0)        ;  volume signature 
  356. drCrDate                 ds.l    1                ; offset: $2 (2)        ;  date and time of volume creation 
  357. drLsMod                     ds.l    1                ; offset: $6 (6)        ;  date and time of last modification 
  358. drAtrb                     ds.w    1                ; offset: $A (10)        ;  volume attributes 
  359. drNmFls                     ds.w    1                ; offset: $C (12)        ;  number of files in root folder 
  360. drVBMSt                     ds.w    1                ; offset: $E (14)        ;  first block of volume bitmap 
  361. drAllocPtr                 ds.w    1                ; offset: $10 (16)        ;  start of next allocation search 
  362. drNmAlBlks                 ds.w    1                ; offset: $12 (18)        ;  number of allocation blocks in volume 
  363. drAlBlkSiz                 ds.l    1                ; offset: $14 (20)        ;  size (in bytes) of allocation blocks 
  364. drClpSiz                 ds.l    1                ; offset: $18 (24)        ;  default clump size 
  365. drAlBlSt                 ds.w    1                ; offset: $1C (28)        ;  first allocation block in volume 
  366. drNxtCNID                 ds.l    1                ; offset: $1E (30)        ;  next unused catalog node ID 
  367. drFreeBks                 ds.w    1                ; offset: $22 (34)        ;  number of unused allocation blocks 
  368. drVN                     ds        Str27            ; offset: $24 (36)        ;  volume name 
  369. ;  Master Directory Block extensions for HFS 
  370. drVolBkUp                 ds.l    1                ; offset: $40 (64)        ;  date and time of last backup 
  371. drVSeqNum                 ds.w    1                ; offset: $44 (68)        ;  volume backup sequence number 
  372. drWrCnt                     ds.l    1                ; offset: $46 (70)        ;  volume write count 
  373. drXTClpSiz                 ds.l    1                ; offset: $4A (74)        ;  clump size for extents overflow file 
  374. drCTClpSiz                 ds.l    1                ; offset: $4E (78)        ;  clump size for catalog file 
  375. drNmRtDirs                 ds.w    1                ; offset: $52 (82)        ;  number of directories in root folder 
  376. drFilCnt                 ds.l    1                ; offset: $54 (84)        ;  number of files in volume 
  377. drDirCnt                 ds.l    1                ; offset: $58 (88)        ;  number of directories in volume 
  378. drFndrInfo                 ds.l    8                ; offset: $5C (92)        ;  information used by the Finder 
  379. drEmbedSigWord             ds.w    1                ; offset: $7C (124)        ;  embedded volume signature (formerly drVCSize) 
  380. drEmbedExtent             ds        HFSExtentDescriptor ; offset: $7E (126) ;  embedded volume location and size (formerly drVBMCSize and drCtlCSize) 
  381. drXTFlSize                 ds.l    1                ; offset: $82 (130)        ;  size of extents overflow file 
  382. drXTExtRec                 ds        HFSExtentRecord ; offset: $86 (134)        ;  extent record for extents overflow file 
  383. drCTFlSize                 ds.l    1                ; offset: $92 (146)        ;  size of catalog file 
  384. drCTExtRec                 ds        HFSExtentRecord ; offset: $96 (150)        ;  extent record for catalog file 
  385. sizeof                     EQU *                    ; size:   $A2 (162)
  386.                         ENDR
  387. ;  HFSPlusVolumeHeader (HFS Plus only) - 512 bytes 
  388. ;  Stored at sector #2 (3rd sector) and second-to-last sector. 
  389. HFSPlusVolumeHeader        RECORD 0
  390. signature                 ds.w    1                ; offset: $0 (0)        ;  volume signature == 'H+' 
  391. version                     ds.w    1                ; offset: $2 (2)        ;  current version is kHFSPlusVersion 
  392. attributes                 ds.l    1                ; offset: $4 (4)        ;  volume attributes 
  393. lastMountedVersion         ds.l    1                ; offset: $8 (8)        ;  implementation version which last mounted volume 
  394. reserved                 ds.l    1                ; offset: $C (12)        ;  reserved - set to zero 
  395. createDate                 ds.l    1                ; offset: $10 (16)        ;  date and time of volume creation 
  396. modifyDate                 ds.l    1                ; offset: $14 (20)        ;  date and time of last modification 
  397. backupDate                 ds.l    1                ; offset: $18 (24)        ;  date and time of last backup 
  398. checkedDate                 ds.l    1                ; offset: $1C (28)        ;  date and time of last disk check 
  399. fileCount                 ds.l    1                ; offset: $20 (32)        ;  number of files in volume 
  400. folderCount                 ds.l    1                ; offset: $24 (36)        ;  number of directories in volume 
  401. blockSize                 ds.l    1                ; offset: $28 (40)        ;  size (in bytes) of allocation blocks 
  402. totalBlocks                 ds.l    1                ; offset: $2C (44)        ;  number of allocation blocks in volume (includes this header and VBM
  403. freeBlocks                 ds.l    1                ; offset: $30 (48)        ;  number of unused allocation blocks 
  404. nextAllocation             ds.l    1                ; offset: $34 (52)        ;  start of next allocation search 
  405. rsrcClumpSize             ds.l    1                ; offset: $38 (56)        ;  default resource fork clump size 
  406. dataClumpSize             ds.l    1                ; offset: $3C (60)        ;  default data fork clump size 
  407. nextCatalogID             ds.l    1                ; offset: $40 (64)        ;  next unused catalog node ID 
  408. writeCount                 ds.l    1                ; offset: $44 (68)        ;  volume write count 
  409. encodingsBitmap             ds        UInt64            ; offset: $48 (72)        ;  which encodings have been use  on this volume 
  410. finderInfo                 ds.b    32                ; offset: $50 (80)        ;  information used by the Finder 
  411. allocationFile             ds        HFSPlusForkData ; offset: $70 (112)        ;  allocation bitmap file 
  412. extentsFile                 ds        HFSPlusForkData ; offset: $C0 (192)        ;  extents B-tree file 
  413. catalogFile                 ds        HFSPlusForkData ; offset: $110 (272)    ;  catalog B-tree file 
  414. attributesFile             ds        HFSPlusForkData ; offset: $160 (352)    ;  extended attributes B-tree file 
  415. startupFile                 ds        HFSPlusForkData ; offset: $1B0 (432)    ;  boot file 
  416. sizeof                     EQU *                    ; size:   $200 (512)
  417.                         ENDR
  418.     ENDIF ; __HFSVOLUMES__ 
  419.  
  420.